home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DEMOS / ARAIDSRC.ZIP / PALLO.ASM < prev    next >
Encoding:
Assembly Source File  |  1980-01-04  |  5.3 KB  |  266 lines

  1. ; This very simple program (!! 286 !! no pmode !! snif !!) only :
  2. ; 1) loads the precalc to code-segment
  3. ; 2) generates weird plasma-texture
  4. ; 3) uses precalcs and adds little extra like :
  5. ;    a) dots in middle of the tunnel are lighter
  6. ;    b) motion blur
  7. ;    3) double pixels in rough way. (hey..it's meant to 286 machines.)
  8. ; Also there's a lot of unused things, but I hope that you only use
  9. ; the idea of this program. If you rip this, it's your fault.
  10. ; This whole thing is very simple and I hope that if you use these
  11. ; kind of effects, use them with STYLE! Tunnel-only effect is very boring..
  12.  
  13. ; PlastiikkiPaketti / Skraappa!Skruuppi  1996  (c) pah just kiddin
  14.  
  15.  
  16. ; This code has no comments! Real coders need no comments. Be a real coder!
  17.  
  18. locals
  19.  
  20. code    SEGMENT para public 'CODE'
  21.         ASSUME cs:code;ds:code
  22.  
  23.         .286
  24.         org 100h
  25.  
  26. staks segment para stack 'stack'
  27.         assume ss:staks
  28.         staka db 200h dup ('ding')
  29. staks ends
  30.  
  31.  
  32. wait_ver MACRO                  ; Odottaa vertical retracea...
  33. local wait,wait2                ; Siis tahdistaa 70Hz:ksi. (Tai sitten ei...)
  34.         push dx
  35.         push ax
  36.         mov     dx,3dah
  37. wait:   in      al,dx
  38.         test    al,8
  39.         jnz     wait
  40. wait2:  in      al,dx
  41.         test    al,8
  42.         jz      wait2
  43.         pop ax
  44.         pop dx
  45. ENDM
  46.  
  47. start:
  48.         jmp main
  49.  
  50. ;****************************************************************************
  51. ; DATA
  52. ;****************************************************************************
  53.  
  54.  
  55. include sin2cos2.inc
  56. include pal.inc
  57. include delshade.inc
  58. include plasma.asm
  59.  
  60. sad dw 0
  61. row db 1
  62. attr db 1
  63.  
  64. ;****************************************************************************
  65. ; PROCEDURES
  66. ;****************************************************************************
  67. setmodetw proc far
  68.         mov ax,0013h
  69.         int 10h
  70.  
  71.         MOV     DX,3c4h
  72.         MOV     AX,604h
  73.         OUT     DX,AX
  74.  
  75.         MOV     DX,3D4h
  76.         MOV     AX,14h
  77.         OUT     DX,AX
  78.         MOV     AX,0E317h
  79.         OUT     DX,AX
  80.         MOV     AL,9
  81.         OUT     DX,AL
  82.  
  83.         INC     DX
  84.         IN      AL,DX
  85.         AND     AL,0E0h
  86.         ADD     AL,8
  87.         OUT     DX,AL
  88.  
  89.         dec     dx
  90.         MOV     AX,0F02h
  91.         OUT     DX,AX
  92.  
  93.         mov     ax,0a000h
  94.         mov     es,ax
  95.         xor     di,di
  96.         mov     cx,32000
  97.         xor     ax,ax
  98.         rep     stosw
  99.  
  100.         ret
  101. setmodetw endp
  102.  
  103. start_add proc near
  104.         push dx
  105.         mov dx,3d4h
  106.         mov al,0ch
  107.         out dx,al
  108.         inc dx
  109.         mov al,bh
  110.         out dx,al
  111.  
  112.         mov al,0dh
  113.         mov dx,3d4h
  114.         out dx,al
  115.         inc dx
  116.         mov al,bl
  117.         out dx,al
  118.         pop dx
  119.         ret
  120. start_add ENDP
  121.  
  122. xl db 0
  123. yl db 0
  124. kr dw 0
  125.  
  126. raid proc near
  127.         mov     ax,seg virt2
  128.         mov     es,ax
  129.         mov     di,offset virt2
  130.         mov     ax,seg tila
  131.         mov     ds,ax
  132.         mov     si,offset precalc
  133.         mov     cx,16000
  134. x_ad:
  135.         mov     bx,cs:[si]
  136.  
  137.         add     bl,xl
  138.         add     bh,yl
  139.  
  140.         mov     al,ds:[bx]
  141.         mov     ah,cs:[si+1]
  142.         neg     ah
  143.         sub     al,ah
  144.         add     es:[di],al
  145.         jnc     iskall
  146.         mov     byte ptr es:[di],255
  147. iskall:
  148.         inc     di
  149.         add     si,2
  150.         loop    x_ad
  151.  
  152.         add     yl,1
  153.         add     xl,1
  154.  
  155.         ret
  156.  
  157. raid endp
  158.  
  159. motion_blur proc near
  160.         mov     ax,seg virt2
  161.         mov     es,ax
  162.         xor     di,di
  163.         xor     bx,bx
  164.         mov     cx,16000
  165. dinaga:
  166.         mov     bl,es:[di]
  167.         mov     al,cs:shade[bx]
  168.         stosb
  169.         loop    dinaga
  170.         ret
  171. motion_blur endp
  172.  
  173.  
  174.  
  175. filename db 'analraid.dat',0
  176.  
  177. main proc far
  178.  
  179.         mov     ax,3d00h
  180.         mov     dx,seg filename
  181.         mov     ds,dx
  182.         mov     dx,offset filename
  183.         int     21h
  184.  
  185.         mov     bx,ax
  186.         mov     cx,16000*2
  187.         mov     ax,cs
  188.         mov     ds,ax
  189.         mov     dx,offset precalc
  190.         mov     ah,3fh
  191.         int     21h
  192.  
  193.         mov     ah,3eh
  194.         int     21h
  195.  
  196.         call    plasma
  197.  
  198.         mov     ax,13h
  199.         int     10h
  200.  
  201.         mov     dx,3c8h
  202.         xor     al,al
  203.         out     dx,al
  204.         inc     dx
  205.         mov     cx,768
  206.         mov     si,offset pal
  207.         mov     ax,seg pal
  208.         mov     ds,ax
  209.         rep     outsb
  210.  
  211.  
  212. rynnkari:
  213.         call    raid
  214.  
  215.         mov     ax,0a000h
  216.         mov     es,ax
  217.         xor     di,di
  218.         mov     ax,seg virt2
  219.         mov     ds,ax
  220.         mov     si,offset virt2
  221.         mov     dx,100
  222. peray:
  223.         mov     cx,160
  224. perax:
  225.         lodsb
  226.         mov     ah,al
  227.         mov     es:[di+320],ax
  228.         stosw
  229.         loop    perax
  230.         add     di,320
  231.         dec     dx
  232.         jnz     peray
  233.  
  234.         call    motion_blur
  235.  
  236.         in      al,60h
  237.         cmp     al,1
  238.         jne     rynnkari
  239.  
  240.         mov     ax,3h
  241.         int     10h
  242.  
  243.         mov     ax,4c00h
  244.         int     21h
  245.  
  246. main endp
  247.  
  248.         precalc db 32000 dup (?)
  249.  
  250.  
  251. code ENDS
  252.  
  253. data3 segment para 'dataz'
  254.         virt2 db 16000 dup (?)
  255. data3 ends
  256.  
  257. data1 segment para 'data0'
  258.         tila db 65535 dup (?)
  259. data1 ends
  260.  
  261. dataa segment para 'dumppi'
  262.         dump db 100 dup (?)
  263. dataa ends
  264.  
  265. end start
  266.